View Javadoc
1 package jrre.instructionset.push.localvariables; 2 3 import jrre.*; 4 import jrre.types.*; 5 6 public class CALoad extends jrre.instructionset.Instruction { 7 8 public CALoad(){ 9 10 name = "caload"; 11 description = "foo"; 12 length = 0; 13 } 14 15 /*** 16 * Executes the <strong><code>caload</code></strong> instruction. 17 * 18 * @param operandStack 19 */ 20 public void execute(){ 21 22 23 PrimitiveType index = (PrimitiveType)Stack.popOperand(); 24 ReferenceType arrayRef = (ReferenceType)Stack.popOperand(); 25 26 ArrayInstance array = (ArrayInstance)arrayRef.getValue(); 27 28 Stack.pushOperand(array.getElement(index.getValue())); 29 } 30 31 public String toString(){ 32 StringBuffer toReturn = new StringBuffer(); 33 toReturn.append("caload "); 34 return toReturn.toString(); 35 } 36 }

This page was automatically generated by Maven